<template>
  <!-- <el-table
    ref="multipleTableRef"
    :data="tableData"
    style="width: 100%"
    @selection-change="handleSelectionChange"
  >
  
    <el-table-column type="selection" width="55" />
    <el-table-column label="Date" width="120">
      <template #default="scope">{{ scope.row.date }}</template>
    </el-table-column>
    <el-table-column property="name" label="Name" width="120" />
    <el-table-column property="address" label="Address" show-overflow-tooltip />
  </el-table>
  <div style="margin-top: 20px">
   <el-pagination
    small
    background
    layout="prev, pager, next"
    :total="50"
    class="mt-4"
  /> -->
  
  <!-- </div> -->
   <el-table
        :data="dataList"
        row-key="id"
        :tree-props="{ children: 'childlist' }"
        
        @selection-change="handleSelectionChange"
      >
        <JmTb
          v-for="item in columns"
          :name="item.label"
          :key="item.prop"
          :prop="item.prop"
          :label="item.label"
          :type="item.type"
          :width="item.width"
          :jv="item.jv"
          :formatter="item.formatter"
        >
        </JmTb>
 
        <el-table-column label="操作" width="220">
          <template #default="scope">
      
            <el-button @click="edit(scope.row.id)" size="mini"
              >编辑</el-button
            >
            <el-button
              type="danger"
              size="mini"
              @click="del(scope.row.id)"
              >删除</el-button
            >
          </template>
        </el-table-column>
      </el-table>
</template>
<script>
 
import JmTb from "./JmTb.vue";
export default {
  name: "JmTable",
  components:{JmTb},
   props:{
		dataList:{ 
		},
    columns:{}
	},
     methods:{ 
     
        edit(name1){
              this.$parent.edit(name1);
        },
        del(_id){
          
          //  await this.$api.menuSubmit({ _id, action: "delete" });
          this.$parent.del(_id);
            // this.$message.success("删除成功");
            
            // console.log('id',_id);
            // this.getDataList()
        },
        handleSelectionChange(val){
           var propArr = [];
        for (var i = 0; i < val.length; i++) {
            propArr.push(val[i]["id"]);
        }
        this.$parent.setids(propArr);
          // console.log(this.getSelectionRows,val);
        }
    },
};	

</script>